package com.slz3.business.module.wmsManagement.wmsStockDetail.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.wmsManagement.wmsStockDetail.domain.WmsStockDetail;
import com.slz3.business.module.wmsManagement.wmsStockDetail.domain.WmsStockDetailCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class WmsStockDetailResController extends WmsStockDetailResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, WmsStockDetail wmsStockDetail) {
        if (WmsStockDetailResUnsafeValid.add(req, wmsStockDetail)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$WmsStockDetailUpdateLock(req, wmsStockDetail);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, WmsStockDetailCondition wmsStockDetailCondition) {
        if (WmsStockDetailResUnsafeValid.delete(req, wmsStockDetailCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$WmsStockDetailUpdateLock(req, wmsStockDetailCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, WmsStockDetail wmsStockDetail) {
        if (WmsStockDetailResUnsafeValid.modify(req, wmsStockDetail)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$WmsStockDetailUpdateLock(req, wmsStockDetail);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (WmsStockDetailResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return wmsStockDetailResAtomic.info_$WmsStockDetailUpdateLock(req);
        if (WmsStockDetailResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$WmsStockDetailUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (WmsStockDetailResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, WmsStockDetailCondition wmsStockDetailCondition) {
        //
        if (WmsStockDetailResUnsafeValid.auditSubmit(req, wmsStockDetailCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$WmsStockDetailUpdateLock(req, wmsStockDetailCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, WmsStockDetailCondition wmsStockDetailCondition) {
        if (WmsStockDetailResUnsafeValid.audit(req, wmsStockDetailCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$WmsStockDetailUpdateLock(req, wmsStockDetailCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, WmsStockDetailCondition wmsStockDetailCondition) {
        if (WmsStockDetailResUnsafeValid.auditReject(req, wmsStockDetailCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$WmsStockDetailUpdateLock(req, wmsStockDetailCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, WmsStockDetailCondition wmsStockDetailCondition) {
        if (WmsStockDetailResUnsafeValid.usingEnable(req, wmsStockDetailCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$WmsStockDetailUpdateLock(req, wmsStockDetailCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, WmsStockDetailCondition wmsStockDetailCondition) {
        if (WmsStockDetailResUnsafeValid.usingDisable(req, wmsStockDetailCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$WmsStockDetailUpdateLock(req, wmsStockDetailCondition);
        }
    }

}
